(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

is_empty(nil) → true
is_empty(cons(x, l)) → false
hd(cons(x, l)) → x
tl(cons(x, l)) → l
append(l1, l2) → ifappend(l1, l2, l1)
ifappend(l1, l2, nil) → l2
ifappend(l1, l2, cons(x, l)) → cons(x, append(l, l2))

Rewrite Strategy: INNERMOST

(1) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

is_empty(nil) → true [1]
is_empty(cons(x, l)) → false [1]
hd(cons(x, l)) → x [1]
tl(cons(x, l)) → l [1]
append(l1, l2) → ifappend(l1, l2, l1) [1]
ifappend(l1, l2, nil) → l2 [1]
ifappend(l1, l2, cons(x, l)) → cons(x, append(l, l2)) [1]

Rewrite Strategy: INNERMOST

(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(4) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

is_empty(nil) → true [1]
is_empty(cons(x, l)) → false [1]
hd(cons(x, l)) → x [1]
tl(cons(x, l)) → l [1]
append(l1, l2) → ifappend(l1, l2, l1) [1]
ifappend(l1, l2, nil) → l2 [1]
ifappend(l1, l2, cons(x, l)) → cons(x, append(l, l2)) [1]

The TRS has the following type information:
is_empty :: nil:cons → true:false
nil :: nil:cons
true :: true:false
cons :: hd → nil:cons → nil:cons
false :: true:false
hd :: nil:cons → hd
tl :: nil:cons → nil:cons
append :: nil:cons → nil:cons → nil:cons
ifappend :: nil:cons → nil:cons → nil:cons → nil:cons

Rewrite Strategy: INNERMOST

(5) CompletionProof (UPPER BOUND(ID) transformation)

The transformation into a RNTS is sound, since:

(a) The obligation is a constructor system where every type has a constant constructor,

(b) The following defined symbols do not have to be completely defined, as they can never occur inside other defined symbols:


is_empty
hd
tl
append
ifappend

(c) The following functions are completely defined:
none

Due to the following rules being added:
none

And the following fresh constants:

const

(6) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

is_empty(nil) → true [1]
is_empty(cons(x, l)) → false [1]
hd(cons(x, l)) → x [1]
tl(cons(x, l)) → l [1]
append(l1, l2) → ifappend(l1, l2, l1) [1]
ifappend(l1, l2, nil) → l2 [1]
ifappend(l1, l2, cons(x, l)) → cons(x, append(l, l2)) [1]

The TRS has the following type information:
is_empty :: nil:cons → true:false
nil :: nil:cons
true :: true:false
cons :: hd → nil:cons → nil:cons
false :: true:false
hd :: nil:cons → hd
tl :: nil:cons → nil:cons
append :: nil:cons → nil:cons → nil:cons
ifappend :: nil:cons → nil:cons → nil:cons → nil:cons
const :: hd

Rewrite Strategy: INNERMOST

(7) NarrowingProof (BOTH BOUNDS(ID, ID) transformation)

Narrowed the inner basic terms of all right-hand sides by a single narrowing step.

(8) Obligation:

Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

is_empty(nil) → true [1]
is_empty(cons(x, l)) → false [1]
hd(cons(x, l)) → x [1]
tl(cons(x, l)) → l [1]
append(l1, l2) → ifappend(l1, l2, l1) [1]
ifappend(l1, l2, nil) → l2 [1]
ifappend(l1, l2, cons(x, l)) → cons(x, append(l, l2)) [1]

The TRS has the following type information:
is_empty :: nil:cons → true:false
nil :: nil:cons
true :: true:false
cons :: hd → nil:cons → nil:cons
false :: true:false
hd :: nil:cons → hd
tl :: nil:cons → nil:cons
append :: nil:cons → nil:cons → nil:cons
ifappend :: nil:cons → nil:cons → nil:cons → nil:cons
const :: hd

Rewrite Strategy: INNERMOST

(9) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

nil => 0
true => 1
false => 0
const => 0

(10) Obligation:

Complexity RNTS consisting of the following rules:

append(z, z') -{ 1 }→ ifappend(l1, l2, l1) :|: z = l1, z' = l2, l1 >= 0, l2 >= 0
hd(z) -{ 1 }→ x :|: x >= 0, l >= 0, z = 1 + x + l
ifappend(z, z', z'') -{ 1 }→ l2 :|: z'' = 0, z = l1, z' = l2, l1 >= 0, l2 >= 0
ifappend(z, z', z'') -{ 1 }→ 1 + x + append(l, l2) :|: z'' = 1 + x + l, z = l1, x >= 0, l >= 0, z' = l2, l1 >= 0, l2 >= 0
is_empty(z) -{ 1 }→ 1 :|: z = 0
is_empty(z) -{ 1 }→ 0 :|: x >= 0, l >= 0, z = 1 + x + l
tl(z) -{ 1 }→ l :|: x >= 0, l >= 0, z = 1 + x + l

(11) SimplificationProof (BOTH BOUNDS(ID, ID) transformation)

Simplified the RNTS by moving equalities from the constraints into the right-hand sides.

(12) Obligation:

Complexity RNTS consisting of the following rules:

append(z, z') -{ 1 }→ ifappend(z, z', z) :|: z >= 0, z' >= 0
hd(z) -{ 1 }→ x :|: x >= 0, l >= 0, z = 1 + x + l
ifappend(z, z', z'') -{ 1 }→ z' :|: z'' = 0, z >= 0, z' >= 0
ifappend(z, z', z'') -{ 1 }→ 1 + x + append(l, z') :|: z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0
is_empty(z) -{ 1 }→ 1 :|: z = 0
is_empty(z) -{ 1 }→ 0 :|: x >= 0, l >= 0, z = 1 + x + l
tl(z) -{ 1 }→ l :|: x >= 0, l >= 0, z = 1 + x + l

(13) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID) transformation)

Found the following analysis order by SCC decomposition:

{ is_empty }
{ ifappend, append }
{ tl }
{ hd }

(14) Obligation:

Complexity RNTS consisting of the following rules:

append(z, z') -{ 1 }→ ifappend(z, z', z) :|: z >= 0, z' >= 0
hd(z) -{ 1 }→ x :|: x >= 0, l >= 0, z = 1 + x + l
ifappend(z, z', z'') -{ 1 }→ z' :|: z'' = 0, z >= 0, z' >= 0
ifappend(z, z', z'') -{ 1 }→ 1 + x + append(l, z') :|: z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0
is_empty(z) -{ 1 }→ 1 :|: z = 0
is_empty(z) -{ 1 }→ 0 :|: x >= 0, l >= 0, z = 1 + x + l
tl(z) -{ 1 }→ l :|: x >= 0, l >= 0, z = 1 + x + l

Function symbols to be analyzed: {is_empty}, {ifappend,append}, {tl}, {hd}

(15) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: is_empty
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(16) Obligation:

Complexity RNTS consisting of the following rules:

append(z, z') -{ 1 }→ ifappend(z, z', z) :|: z >= 0, z' >= 0
hd(z) -{ 1 }→ x :|: x >= 0, l >= 0, z = 1 + x + l
ifappend(z, z', z'') -{ 1 }→ z' :|: z'' = 0, z >= 0, z' >= 0
ifappend(z, z', z'') -{ 1 }→ 1 + x + append(l, z') :|: z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0
is_empty(z) -{ 1 }→ 1 :|: z = 0
is_empty(z) -{ 1 }→ 0 :|: x >= 0, l >= 0, z = 1 + x + l
tl(z) -{ 1 }→ l :|: x >= 0, l >= 0, z = 1 + x + l

Function symbols to be analyzed: {is_empty}, {ifappend,append}, {tl}, {hd}
Previous analysis results are:
is_empty: runtime: ?, size: O(1) [1]

(17) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: is_empty
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(18) Obligation:

Complexity RNTS consisting of the following rules:

append(z, z') -{ 1 }→ ifappend(z, z', z) :|: z >= 0, z' >= 0
hd(z) -{ 1 }→ x :|: x >= 0, l >= 0, z = 1 + x + l
ifappend(z, z', z'') -{ 1 }→ z' :|: z'' = 0, z >= 0, z' >= 0
ifappend(z, z', z'') -{ 1 }→ 1 + x + append(l, z') :|: z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0
is_empty(z) -{ 1 }→ 1 :|: z = 0
is_empty(z) -{ 1 }→ 0 :|: x >= 0, l >= 0, z = 1 + x + l
tl(z) -{ 1 }→ l :|: x >= 0, l >= 0, z = 1 + x + l

Function symbols to be analyzed: {ifappend,append}, {tl}, {hd}
Previous analysis results are:
is_empty: runtime: O(1) [1], size: O(1) [1]

(19) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(20) Obligation:

Complexity RNTS consisting of the following rules:

append(z, z') -{ 1 }→ ifappend(z, z', z) :|: z >= 0, z' >= 0
hd(z) -{ 1 }→ x :|: x >= 0, l >= 0, z = 1 + x + l
ifappend(z, z', z'') -{ 1 }→ z' :|: z'' = 0, z >= 0, z' >= 0
ifappend(z, z', z'') -{ 1 }→ 1 + x + append(l, z') :|: z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0
is_empty(z) -{ 1 }→ 1 :|: z = 0
is_empty(z) -{ 1 }→ 0 :|: x >= 0, l >= 0, z = 1 + x + l
tl(z) -{ 1 }→ l :|: x >= 0, l >= 0, z = 1 + x + l

Function symbols to be analyzed: {ifappend,append}, {tl}, {hd}
Previous analysis results are:
is_empty: runtime: O(1) [1], size: O(1) [1]

(21) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using CoFloCo for: ifappend
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z' + z''

Computed SIZE bound using CoFloCo for: append
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z + z'

(22) Obligation:

Complexity RNTS consisting of the following rules:

append(z, z') -{ 1 }→ ifappend(z, z', z) :|: z >= 0, z' >= 0
hd(z) -{ 1 }→ x :|: x >= 0, l >= 0, z = 1 + x + l
ifappend(z, z', z'') -{ 1 }→ z' :|: z'' = 0, z >= 0, z' >= 0
ifappend(z, z', z'') -{ 1 }→ 1 + x + append(l, z') :|: z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0
is_empty(z) -{ 1 }→ 1 :|: z = 0
is_empty(z) -{ 1 }→ 0 :|: x >= 0, l >= 0, z = 1 + x + l
tl(z) -{ 1 }→ l :|: x >= 0, l >= 0, z = 1 + x + l

Function symbols to be analyzed: {ifappend,append}, {tl}, {hd}
Previous analysis results are:
is_empty: runtime: O(1) [1], size: O(1) [1]
ifappend: runtime: ?, size: O(n1) [z' + z'']
append: runtime: ?, size: O(n1) [z + z']

(23) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using PUBS for: ifappend
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 1 + 2·z''

Computed RUNTIME bound using CoFloCo for: append
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: 2 + 2·z

(24) Obligation:

Complexity RNTS consisting of the following rules:

append(z, z') -{ 1 }→ ifappend(z, z', z) :|: z >= 0, z' >= 0
hd(z) -{ 1 }→ x :|: x >= 0, l >= 0, z = 1 + x + l
ifappend(z, z', z'') -{ 1 }→ z' :|: z'' = 0, z >= 0, z' >= 0
ifappend(z, z', z'') -{ 1 }→ 1 + x + append(l, z') :|: z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0
is_empty(z) -{ 1 }→ 1 :|: z = 0
is_empty(z) -{ 1 }→ 0 :|: x >= 0, l >= 0, z = 1 + x + l
tl(z) -{ 1 }→ l :|: x >= 0, l >= 0, z = 1 + x + l

Function symbols to be analyzed: {tl}, {hd}
Previous analysis results are:
is_empty: runtime: O(1) [1], size: O(1) [1]
ifappend: runtime: O(n1) [1 + 2·z''], size: O(n1) [z' + z'']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']

(25) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(26) Obligation:

Complexity RNTS consisting of the following rules:

append(z, z') -{ 2 + 2·z }→ s :|: s >= 0, s <= 1 * z' + 1 * z, z >= 0, z' >= 0
hd(z) -{ 1 }→ x :|: x >= 0, l >= 0, z = 1 + x + l
ifappend(z, z', z'') -{ 1 }→ z' :|: z'' = 0, z >= 0, z' >= 0
ifappend(z, z', z'') -{ 3 + 2·l }→ 1 + x + s' :|: s' >= 0, s' <= 1 * l + 1 * z', z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0
is_empty(z) -{ 1 }→ 1 :|: z = 0
is_empty(z) -{ 1 }→ 0 :|: x >= 0, l >= 0, z = 1 + x + l
tl(z) -{ 1 }→ l :|: x >= 0, l >= 0, z = 1 + x + l

Function symbols to be analyzed: {tl}, {hd}
Previous analysis results are:
is_empty: runtime: O(1) [1], size: O(1) [1]
ifappend: runtime: O(n1) [1 + 2·z''], size: O(n1) [z' + z'']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']

(27) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: tl
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z

(28) Obligation:

Complexity RNTS consisting of the following rules:

append(z, z') -{ 2 + 2·z }→ s :|: s >= 0, s <= 1 * z' + 1 * z, z >= 0, z' >= 0
hd(z) -{ 1 }→ x :|: x >= 0, l >= 0, z = 1 + x + l
ifappend(z, z', z'') -{ 1 }→ z' :|: z'' = 0, z >= 0, z' >= 0
ifappend(z, z', z'') -{ 3 + 2·l }→ 1 + x + s' :|: s' >= 0, s' <= 1 * l + 1 * z', z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0
is_empty(z) -{ 1 }→ 1 :|: z = 0
is_empty(z) -{ 1 }→ 0 :|: x >= 0, l >= 0, z = 1 + x + l
tl(z) -{ 1 }→ l :|: x >= 0, l >= 0, z = 1 + x + l

Function symbols to be analyzed: {tl}, {hd}
Previous analysis results are:
is_empty: runtime: O(1) [1], size: O(1) [1]
ifappend: runtime: O(n1) [1 + 2·z''], size: O(n1) [z' + z'']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
tl: runtime: ?, size: O(n1) [z]

(29) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: tl
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(30) Obligation:

Complexity RNTS consisting of the following rules:

append(z, z') -{ 2 + 2·z }→ s :|: s >= 0, s <= 1 * z' + 1 * z, z >= 0, z' >= 0
hd(z) -{ 1 }→ x :|: x >= 0, l >= 0, z = 1 + x + l
ifappend(z, z', z'') -{ 1 }→ z' :|: z'' = 0, z >= 0, z' >= 0
ifappend(z, z', z'') -{ 3 + 2·l }→ 1 + x + s' :|: s' >= 0, s' <= 1 * l + 1 * z', z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0
is_empty(z) -{ 1 }→ 1 :|: z = 0
is_empty(z) -{ 1 }→ 0 :|: x >= 0, l >= 0, z = 1 + x + l
tl(z) -{ 1 }→ l :|: x >= 0, l >= 0, z = 1 + x + l

Function symbols to be analyzed: {hd}
Previous analysis results are:
is_empty: runtime: O(1) [1], size: O(1) [1]
ifappend: runtime: O(n1) [1 + 2·z''], size: O(n1) [z' + z'']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
tl: runtime: O(1) [1], size: O(n1) [z]

(31) ResultPropagationProof (UPPER BOUND(ID) transformation)

Applied inner abstraction using the recently inferred runtime/size bounds where possible.

(32) Obligation:

Complexity RNTS consisting of the following rules:

append(z, z') -{ 2 + 2·z }→ s :|: s >= 0, s <= 1 * z' + 1 * z, z >= 0, z' >= 0
hd(z) -{ 1 }→ x :|: x >= 0, l >= 0, z = 1 + x + l
ifappend(z, z', z'') -{ 1 }→ z' :|: z'' = 0, z >= 0, z' >= 0
ifappend(z, z', z'') -{ 3 + 2·l }→ 1 + x + s' :|: s' >= 0, s' <= 1 * l + 1 * z', z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0
is_empty(z) -{ 1 }→ 1 :|: z = 0
is_empty(z) -{ 1 }→ 0 :|: x >= 0, l >= 0, z = 1 + x + l
tl(z) -{ 1 }→ l :|: x >= 0, l >= 0, z = 1 + x + l

Function symbols to be analyzed: {hd}
Previous analysis results are:
is_empty: runtime: O(1) [1], size: O(1) [1]
ifappend: runtime: O(n1) [1 + 2·z''], size: O(n1) [z' + z'']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
tl: runtime: O(1) [1], size: O(n1) [z]

(33) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed SIZE bound using KoAT for: hd
after applying outer abstraction to obtain an ITS,
resulting in: O(n1) with polynomial bound: z

(34) Obligation:

Complexity RNTS consisting of the following rules:

append(z, z') -{ 2 + 2·z }→ s :|: s >= 0, s <= 1 * z' + 1 * z, z >= 0, z' >= 0
hd(z) -{ 1 }→ x :|: x >= 0, l >= 0, z = 1 + x + l
ifappend(z, z', z'') -{ 1 }→ z' :|: z'' = 0, z >= 0, z' >= 0
ifappend(z, z', z'') -{ 3 + 2·l }→ 1 + x + s' :|: s' >= 0, s' <= 1 * l + 1 * z', z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0
is_empty(z) -{ 1 }→ 1 :|: z = 0
is_empty(z) -{ 1 }→ 0 :|: x >= 0, l >= 0, z = 1 + x + l
tl(z) -{ 1 }→ l :|: x >= 0, l >= 0, z = 1 + x + l

Function symbols to be analyzed: {hd}
Previous analysis results are:
is_empty: runtime: O(1) [1], size: O(1) [1]
ifappend: runtime: O(n1) [1 + 2·z''], size: O(n1) [z' + z'']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
tl: runtime: O(1) [1], size: O(n1) [z]
hd: runtime: ?, size: O(n1) [z]

(35) IntTrsBoundProof (UPPER BOUND(ID) transformation)


Computed RUNTIME bound using CoFloCo for: hd
after applying outer abstraction to obtain an ITS,
resulting in: O(1) with polynomial bound: 1

(36) Obligation:

Complexity RNTS consisting of the following rules:

append(z, z') -{ 2 + 2·z }→ s :|: s >= 0, s <= 1 * z' + 1 * z, z >= 0, z' >= 0
hd(z) -{ 1 }→ x :|: x >= 0, l >= 0, z = 1 + x + l
ifappend(z, z', z'') -{ 1 }→ z' :|: z'' = 0, z >= 0, z' >= 0
ifappend(z, z', z'') -{ 3 + 2·l }→ 1 + x + s' :|: s' >= 0, s' <= 1 * l + 1 * z', z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0
is_empty(z) -{ 1 }→ 1 :|: z = 0
is_empty(z) -{ 1 }→ 0 :|: x >= 0, l >= 0, z = 1 + x + l
tl(z) -{ 1 }→ l :|: x >= 0, l >= 0, z = 1 + x + l

Function symbols to be analyzed:
Previous analysis results are:
is_empty: runtime: O(1) [1], size: O(1) [1]
ifappend: runtime: O(n1) [1 + 2·z''], size: O(n1) [z' + z'']
append: runtime: O(n1) [2 + 2·z], size: O(n1) [z + z']
tl: runtime: O(1) [1], size: O(n1) [z]
hd: runtime: O(1) [1], size: O(n1) [z]

(37) FinalProof (EQUIVALENT transformation)

Computed overall runtime complexity

(38) BOUNDS(1, n^1)